package com.aaa.controller;


import com.aaa.dao.DeptDao;
import com.aaa.entity.Dept;
import com.aaa.service.DeptDaoService;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author C-Q
 * @version 1.1.0
 * @Description: TODO
 * @date 2022/9/24
 */
@Controller
@RequestMapping("dept")
public class DeptController {
    @Autowired
    private DeptDaoService deptDaoService;
    @RequestMapping("list")
    @ResponseBody
    public Result list(){

        List<Dept> all = deptDaoService.findAll();
        Result result = new Result(200,"查询成功",all);
        return result;
    }
}
